<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/view/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">    
      <link rel="stylesheet" type="text/css" href="./estilos.css"/>  	
  	
<h:form id="formConsultarAvaliacaoFisica" prependId="false">  
	<p:panel id="panelConsultarAvaliacaoFisica" header="Consultar AvaliacaoFisica" style=" margin-bottom:20px; ">  
		<f:facet name="header">
			<h:outputText value="Consultar Avaliação Física" styleClass="outputTextTitulo"/>
		</f:facet>
 	<p:messages id="messagesConsultarAvFisica" closable="true"/> 
  		<h:panelGrid id="pgAvFisicaConsProfessor" columns="2" style="text-align:center; margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Funcionario" styleClass="outputLabel"/>            
            <p:inputText id="inputFuncionarioNome" value="#{avaliacaoFisicaBean.avaliacaoFisica.funcionario.idFuncionario}" styleClass="inputId">  
  				<p:ajax  listener="#{avaliacaoFisicaBean.onChangeFuncionario}" update="pgAvFisicaConsProfessor, messagesConsultarAvFisica" />
            </p:inputText>  
  			<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.funcionario.nome}" maxlength="40" styleClass="inputDescricao"/> 
        </h:panelGrid> 
        <h:panelGrid id="pgAvFisicaConsAluno" columns="2" style="text-align:center; margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Aluno" styleClass="outputLabel"/>            
            <p:inputText id="inputAlunoNome" value="#{avaliacaoFisicaBean.avaliacaoFisica.aluno.idAluno}" styleClass="inputId">  
  				<p:ajax  listener="#{avaliacaoFisicaBean.onChangeAluno}" update="pgAvFisicaConsAluno, messagesConsultarAvFisica" />
            </p:inputText>  
  			<p:inputText  value="#{avaliacaoFisicaBean.avaliacaoFisica.aluno.nome}" maxlength="40" styleClass="inputDescricao"/>
        </h:panelGrid>   
        
    </p:panel>  
    <p:commandButton value="Consultar" actionListener="#{avaliacaoFisicaBean.findAvaliacaoFisica}" update="dataTableAvaliacaoFisica" style="margin-right:20px; margin-left:10px;" /> 
	<p:commandButton value="Novo" action="#{avaliacaoFisicaBean.selecionaAluno}" style="margin-right:20px;" /> 
	<p:commandButton value="Limpar"  actionListener="#{avaliacaoFisicaBean.clean}" update="panelConsultarAvaliacaoFisica, dataTableAvaliacaoFisica" style="margin-right:20px;" />
    <p:dataTable id="dataTableAvaliacaoFisica" var="AvaliacaoFisica" value="#{avaliacaoFisicaBean.dmAvaliacaoFisica}"  
    			 rowKey="#{AvaliacaoFisica.idAvaliacaoFisica}"  selectionMode="single"
                 style="padding-top:20px; width:60%" paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">   
		<p:column sortBy="#{AvaliacaoFisica.idAvaliacaoFisica}" style="width:10%; text-align:center">  
            <f:facet name="header">  
                <h:outputText value="Código " />  
            </f:facet>  
            <h:outputText value="#{AvaliacaoFisica.idAvaliacaoFisica}" />  
        </p:column>  		
        <p:column sortBy="#{AvaliacaoFisica.aluno.nome}">  
            <f:facet name="header">  
                <h:outputText value="Aluno" />  
            </f:facet>  
            <h:outputText value="#{AvaliacaoFisica.aluno.nome}" />  
        </p:column>  		
        <p:column sortBy="#{AvaliacaoFisica.funcionario.nome}">  
            <f:facet name="header">  
                <h:outputText value="Professor" />  
            </f:facet>  
            <h:outputText value="#{AvaliacaoFisica.funcionario.nome}" />  
        </p:column>  		
        <p:column sortBy="#{AvaliacaoFisica.dtAvaliacao}">  
            <f:facet name="header">  
                <h:outputText value="Data" />
            </f:facet>  
            <h:outputText value="#{AvaliacaoFisica.dtAvaliacao}" > 
            	<f:convertDateTime dateStyle="medium"/>
            </h:outputText>   
        </p:column>         
        <p:column style="width:4%; text-aling:center">  
        	<f:facet name="header">
        		<h:outputText value="Editar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar"  icon="ui-icon-pencil" title="Detail" action="#{avaliacaoFisicaBean.editarAvaliacaoFisica}" />
        </p:column>
    </p:dataTable>  
</h:form>  	
</ui:define>
</ui:composition>
